package org.ch04.test00.demo03;

import java.util.Arrays;

/**
 * @author CSY
 * @date 2025 - 03 - 28
 */
@Desc(checkSex = {"男","man","male","1"},checkHobbies = {"游戏","看书","跑步","锻炼","睡觉","打球"})
public class Student {
    private String name;
    private String sex;
    private String[] hobby;

    public Student(){}

    public Student(String name, String sex, String[] hobby) {
        this.name = name;
        this.sex = CheckField.limitSex(sex);
        this.hobby = CheckField.limitHobbies(hobby);
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = CheckField.limitSex(sex);
    }

    public String[] getHobby() {
        return hobby;
    }

    public void setHobby(String[] hobby) {
        this.hobby = CheckField.limitHobbies(hobby);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", hobby=" + Arrays.toString(hobby) +
                '}';
    }
}
